package com.cnap.multiclouldmgmt.model.scale.policy;

import com.cnap.multiclouldmgmt.model.scale.validator.ValidInterface;

/**
 * <类文件描述>
 *
 * @author xc
 **/
public enum ScalingDeletePolicyEnum implements ValidInterface {
    // 先入先出
    FIFO("FIFO"),
    // 后入先出
    LIFO("LIFO"),
    ;
    private final String policy;

    ScalingDeletePolicyEnum(String policy) {
        this.policy = policy;
    }

    public String getPolicy() {
        return policy;
    }


    @Override
    public boolean isValid(String value) {
        ScalingDeletePolicyEnum[] scalingDeletePolicyEnums = ScalingDeletePolicyEnum.values();
        for (ScalingDeletePolicyEnum scalingDeletePolicyEnum : scalingDeletePolicyEnums) {
            if (scalingDeletePolicyEnum.getPolicy().equals(value)) {
                return true;
            }
        }
        return false;
    }
}
